﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DomainModel.Entities;
using FluentNHibernate.Mapping;

namespace DomainModel.ClassMaps
{
    public class UndeliveredMessageClassMap : ClassMap<UndeliveredMessage>
    {
        public UndeliveredMessageClassMap()
        {
            Table("UndeliveredMessages");
            Id(x => x.MessageId, "message_id").GeneratedBy.Native();
            Map(x => x.DateSent, "date_sent");
            //Map(x => x.FromUserId, "from_user_id");

            //Map(x => x.ToUserId, "to_user_id");

            References(x => x.FromUser, "from_user_id").Cascade.All();
            References(x => x.ToUser, "to_user_id").Cascade.All();
        }
    }
}
